package com.mzkj.wanjulaile.mobile.api.modules.account.mapper;

import com.mzkj.wanjulaile.mobile.api.modules.account.entity.Account;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by wangxw on 16/7/26.
 */
@Repository
public interface AccountMapper{
    /**
     * 根据手机号查询用户
     *
     * @param phone 手机号
     * @return
     */

    Account getByPhone(String  phone);

    void insert(Account account);

    /**
     * @param id
     * @return
     */
    @Select("SELECT id, nick_name, phone FROM account where id = #{id}")
    Account getAccount(String id);

    @Select("select id, nick_name, phone from account")
    List<Account> findList();

    int update(Account account);

    Account getById(String id);

//    Account findAccountByOpenid(String openid);

    Account getCurVip(Account account);

    List<Account> findVipAccount();

    void setNullVipTime(Account account);

    Account get(String id);

    Account get(Account account);

    Account  getByUnionId(String UnionID);

    void updateAccountNick(Account account);

    void updateAccountImg(Account account);

    Account findAccountByOpenid(String openid);
}
